package com.vcredit.creditcat.web.app;

import javax.servlet.http.HttpServletRequest;

import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.dubbo.config.annotation.Reference;
import com.vcredit.creditcat.api.IJdProcessManager;
import com.vcredit.creditcat.dto.emallcredit.JdProcessInDto;
import com.vcredit.creditcat.model.Cust;
import com.vcredit.creditcat.vo.JsonResult;
import com.vcredit.framework.annotation.Log;

/***
 * 京东相关
 *
 */
@RequestMapping(value = "/jd")
@RestController
public class JDProcessController extends BaseCreditCatController {

	@Reference(version = "1.0")
	private IJdProcessManager jdProcessManager;

	/**
	 * 京东登录接口
	 * @param param
	 * @param request
	 * @return
	 * @throws Exception
	 */
	@SuppressWarnings("rawtypes")
	@RequestMapping(value = "/login")
	@Log
	public JsonResult jdLogin(@RequestBody JdProcessInDto param, HttpServletRequest request) throws Exception {
		Cust cust = super.getCust(request);
		jdProcessManager.login(cust, param);
		return JsonResult.SuccessResponse(null);
	}
}
